<extend name="Base/base" />

<block name='body'>

    <div class="dashboard-wrapper">

        <!-- Left Sidebar Start -->
        <div class="left-sidebar">
            <div class="row">
                <div class="col-md-12 col-lg-12">
                    <nav class="navbar navbar-default" role="navigation">
                        <div class="container">
                            <!-- Brand and toggle get grouped for better mobile display -->
                            <div class="navbar-header">

                                <a class="navbar-brand" href="{:U('Index/index')}" data-original-title="" title="">首页 》</a>
                            </div>

                            <!-- Collect the nav links, forms, and other content for toggling -->
                            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-9">

                                <a class="navbar-brand" href="{:U('GoodsClass/index')}" data-original-title="" title="">品牌列表  》 <empty name="info['id']"> 添加<else/> 编辑</empty> </a>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
            <!-- Row Start -->
            <div class="row-fluid">
                <div class="span12">
                    <form action="{:U('')}" class="form1 form-horizontal row-border" >
                        <div class="form-group">
                            <label class="col-md-2 control-label">分类名称</label>
                            <div class="col-md-10">
                                <input type="text" name="gc_name" value="{$info.gc_name}" placeholder="用于后台显示的配置标题" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">分类图片</label>
                            <div class="col-md-10">
                                <div class="upload_file-button" onclick="$('.select_image_upload').click();
                                    return false;">
                                   
                                </div>
                                  
                                <div class="upload-img-box" onclick="$('.select_image_upload').click();
                                    return false;"> </div>
                                <input type="file"  name="download" class="input-file select_image_upload"   style="display: none;" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">排序</label>
                            <div class="col-md-10">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <input type="text" name="sort" value="{$info.gc_sort|defalut=0}" class="form-control" placeholder="0">
                                    </div>
                                </div>   
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="country" class="col-sm-2 control-label">上级菜单</label>
                            <div class="col-sm-10">
                                <select name="gc_parent_id" class="form-control">
                                    <option value="{$info.gc_parent_id|default=0}">{$info.gc_parent_name|default='顶级菜单'}</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">类型</label>
                            <div class="col-md-10">
                                <div class="rdio rdio-primary">
                                    <input type="radio" id="male" value="0" name="type_id"  checked="checked">
                                    <label for="male">无类型</label>
                                </div>

                                <volist name="typelist" id="typevo">
                                    <div class="rdio rdio-primary">
                                        <input type="radio" value="{$typevo.type_id}" id="female_{$typevo.type_id}" name="type_id"  >
                                        <label for="female_{$typevo.type_id}">{$typevo.type_name}</label>
                                    </div>
                                </volist>    
                            </div>
                        </div> 
                     



                      
                        <input type="hidden" name="gc_id" value="{$info.gc_id|default=''}">        
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-info"><empty name="info['gc_id']">新增<else />修改</empty>分类</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <!-- Row End -->           

        </div>
        <!-- Left Sidebar End -->

        <!-- Right Sidebar Start -->
        <div class="right-sidebar">
            <div class="wrapper">
                <a href="{:U('GoodsClass/index')}"><button class="btn btn-block btn-info" type="button">
                        返回列表
                    </button></a>
            </div>

            <hr class="hr-stylish-1">

            <div class="wrapper">
                <div class="widget-body">
                    <form class="form-horizontal no-margin">
                        <div class="form-group">
                            <label for="userName" class="col-sm-12 control-label">品牌名称</label>
                            <div class="col-sm-12">
                                <input type="text" class="form-control" id="userName" placeholder="Name">
                            </div>
                        </div>



                        <div class="form-group">
                            <div class="col-sm-10">
                                <button type="submit" class="btn btn-info">搜索</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>






        </div>
        <!-- Right Sidebar End -->

    </div>
</block>
<block name="javascript">
    <script type="text/javascript" src="__STATIC__/js/fireupload/jquery.iframe-transport.js" charset="utf-8"></script> 
    <script type="text/javascript" src="__STATIC__/js/fireupload/vendor/jquery.ui.widget.js" charset="utf-8"></script> 
    <script type="text/javascript" src="__STATIC__/js/fireupload/jquery.fileupload.js" charset="utf-8"></script>
    <script type="text/javascript">
                                  $(".select_image_upload").fileupload({
                                      dataType: 'json',
                                      url: U('/File/upload'),
                                      formData: {},
                                      add: function (e, data) {

                                          data.submit();
                                      },
                                      done: function (e, data) {
                                          var param = data.result;
                                          if (param.status == 1) {
                                             $(this).parent().find(".upload-img-box").html('<input type="hidden" name="gc_images" value="'+param.id+'" /><img width="100" height="100" src="/Uploads/Imgs/'+param.savepath+'/'+param.savename+'"> <em class="edit_img_icon">&nbsp;</em>');
                   
                                          } else {
                                              ui.error(param.info);
                                          }

                                      }
                                  });
                                  Lqw.highlight_subnav("{:U('GoodsClass/index')}");
    </script>    
</block>